<template>
	<div class="list-header list-header-zyzq">
		<p class="header-left">
				<Iconfont @click.native="goBack" iconClass="iconfont iconright"/>
				<Iconfont @click.native="closeAll" iconClass="iconfont iconcha" />
		</p>	
		<p class="header-center">{{title}}</p>
		<p class="header-right">
            <Iconfont v-if="isSearch" iconClass="sousuo begin-search-ru" @click.native="funBtn('search')" />
			<span  v-if="isRule" @click="funBtn('rule')">兑换规则<i class="iconfont iconwenhao"></i></span>
        </p>
	</div>
</template>
<script>
	import fun from "../../util/function";
	export default {
        props: {
            title:{
                type:String,
                default:'中银证券直播间'
            },
            isSearch:{
                type:Boolean,
                default:false
			},
			isRule:{
				type:Boolean,
				default:false
			},
			isPlay:{
				type:Boolean,
				default:false
			}
        },
		data() {
			return {
				params:{
					action:'58235'
				}
				
			}
        },
        
		created() {

		},
		mounted() {
			
		},
		
		
		computed: {
			
		},
		methods: {
            // 返回
            goBack(){
				
				let currentPath = this.$route.path
				if(currentPath == '/zyzq/zyzqHome'||currentPath=='/zyzq/mine'){
					// 关闭h5
					if(window.MyWebView){
					    window.MyWebView.tzt_hsCallNativeFunctionFromWeb("reqaction",JSON.stringify(this.params))
					    return
				}
				}else{
					// 中银证券 个人中心（账号）
				if(window.MyWebView){
					let params = {action:'10002'} 
					window.MyWebView.tzt_hsCallNativeFunctionFromWeb("reqaction", JSON.stringify(params))
					return
				}
				this.$router.go(-1)
				}      
            },
            //退出直播间
            closeAll(){
				if(window.MyWebView){
					window.MyWebView.tzt_hsCallNativeFunctionFromWeb("reqaction",JSON.stringify(this.params))
					return
				}
            },
			 // 点击事件
            funBtn(val){
				this.$emit('formChildMsg', {
					type: val,
					data: {'Msg': 'liuyu'}
				})
			},
		}
	};
</script>
<style scoped="scoped">
	 .list-header.list-header-zyzq{
		width: 100vw;
		height: 88px;
		display: flex;
		align-items: center;
		background: #EB3C3C;
	}

	
	.header-left,
	.header-right {
		height: 100%;
        width: 200px;
		display: flex;
		align-items: center;
	}
	
	.header-left .iconfont,
	.header-right .iconfont{
		font-size: 36px;
		color: #FEFEFE;
	}
	.header-left .iconright{
		margin-right: 45px;
	}
	.header-left{
      padding-left: 20px;
	 
	}
	.header-right{
        display: flex;
        flex-flow: row-reverse;
        padding-right: 30px;
	}
	.header-center{
		flex: 1;
		text-align: center;		
		font-size: 36px;
		font-weight: 400;
		color: #FEFEFE;
	}

	.header-right span{
		color: #FEFEFE;
        font-size: 26px;

	}
	.header-right .iconwenhao{
		margin-left: 10px;
		font-size: 14px;
		font-weight: 500;
	}
	
</style>